CC = g++
PYLIB = -I/usr/include/python3.6m

cBBox_fish.so: cBBox_fish.o dfs.o dvs.o py_wrapper.o
	$(CC) -O2 -Wall -shared -std=c++11 -fPIC $^ -o $@ $(PYLIB)

cBBox_fish.o: cBBox_fish.cpp cBBox_fish.h
	$(CC) -c -Ofast -Wall -std=c++11 -fPIC $< -o $@ -lm $(PYLIB)

dfs.o: dfs.cpp fishTool.h
	$(CC) -c -O -Wall -std=c++11 -fPIC $< -o $@

dvs.o: dvs.cpp fishTool.h i2c-dev.h
	$(CC) -c -O -Wall -std=c++11 -fPIC $< -o $@

py_wrapper.o: py_wrapper.cpp cBBox_fish.h
	$(CC) -c -O -Wall -std=c++11 -fPIC $< -o $@ $(PYLIB)

clean:
	rm *.o *.so
